import { get, post, postFormData, deleteR, put, deleteFormData } from './axios'
import Vue from 'vue'
const serverUrl = Vue.prototype.$config.serverUrl + '/api'
const api = {
  Common: {},
  Article: {
    CreateArticle(params) {
      return post(serverUrl + '/Article/CreateArticle', params)
    },
    GetArticleList(params) {
      return get(serverUrl + '/Article/GetArticleList', params)
    },
    GetArticle(params) {
      return get(serverUrl + '/Article/GetArticle', params)
    },
    UpLoadArticleImage(params) {
      return postFormData(serverUrl + '/Article/UpLoadArticleImage', params)
    },
    DeleteArticleImage(params) {
      return deleteR(serverUrl + '/Article/DeleteArticleImage', params)
    },
    UpdateArticle(params) {
      return put(serverUrl + '/Article/UpdateArticle', params)
    }
  },
  ArticleType: {
    CreateArticleType(params) {
      return postFormData(serverUrl + '/ArticleType/CreateArticleType', params)
    },
    GetArticleTypeList(params) {
      return get(serverUrl + '/ArticleType/GetArticleTypeList', params)
    },
    GetArticleTypeDic(params) {
      return get(serverUrl + '/ArticleType/GetArticleTypeDic', params)
    },
    DeleteArticleType(params) {
      return deleteR(serverUrl + '/ArticleType/DeleteArticleType', params)
    }
  },
  Tag: {
    CreateTag(params) {
      return post(serverUrl + '/Tag/CreateTag', params)
    },
    GetTagList(params) {
      return get(serverUrl + '/Tag/GetTagList', params)
    },
    GetTagDic(params) {
      return get(serverUrl + '/Tag/GetTagDic', params)
    },
    DeleteTag(params) {
      return deleteR(serverUrl + '/Tag/DeleteTag', params)
    }
  }
}
export default api
